//
//  GXLoginViewController.m
//  YIChuSeller
//
//  Created by 田小椿 on 2018/11/26.
//  Copyright © 2018年 xiangshengjun. All rights reserved.
//

#import "GXLoginViewController.h"
#import "PhoneLogin.h"
#import "PasswordLogin.h"
@interface GXLoginViewController (){
    
}
@property (weak, nonatomic) IBOutlet UIView *passwordLineView;
@property (weak, nonatomic) IBOutlet UIView *phoneLineView;
@property(nonatomic,strong) PhoneLogin *phoneLogin;
@property(nonatomic,strong) PasswordLogin *passwordLogin;
@property (weak, nonatomic) IBOutlet UIButton *passwordBtn;
@property (weak, nonatomic) IBOutlet UIButton *phoneBtn;
@end

@implementation GXLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self creatShopView];
    [self creatPasswordLogin];
    self.passwordLineView.hidden = YES;
    self.phoneBtn.selected = YES;
}

- (void)creatShopView
{
    PhoneLogin * phoneLogin = [PhoneLogin phoneLogin];
    phoneLogin.frame = CGRectMake(0,200,kUIScreenWidth,370);
    self.phoneLogin = phoneLogin;
    [self.view addSubview: self.phoneLogin];
    
}

- (void)creatPasswordLogin
{
    PasswordLogin * passwordLogin = [PasswordLogin passwordLogin];
     passwordLogin.frame = CGRectMake(0,200,kUIScreenWidth,370);
    self.passwordLogin = passwordLogin;
    
}
- (IBAction)phoneLoginAction:(id)sender {
    [self.passwordLogin removeFromSuperview];
    [self.view addSubview:self.phoneLogin];
    [self setPhoneViewSelectState];
}
- (IBAction)passwordLoginAction:(id)sender {
    [self.phoneLogin removeFromSuperview];
    [self.view addSubview:self.passwordLogin];
    [self setPasswordViewSelectState];
}
- (void)setPhoneViewSelectState
{
    self.passwordLineView.hidden = YES;
    self.phoneLineView.hidden = NO;
    self.phoneBtn.selected = YES;
    self.passwordBtn.selected = NO;
}
- (void)setPasswordViewSelectState
{
    self.phoneLineView.hidden = YES;
    self.passwordLineView.hidden = NO;
    self.passwordBtn.selected = YES;
    self.phoneBtn.selected = NO;
}


//15608449516 zz
@end
